package com.financing.wap.service.impl;


import java.sql.SQLException;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.financing.wap.dto.FpShopUserRelProductDetailDTO;
import com.financing.wap.service.IFpShopUserRelProductDetailService;
import com.financing.wap.dao.IFpShopUserRelProductDetailDao;
/**
 * fp_shop_user_rel_product_detail  
 *  业务访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpShopUserRelProductDetailService")
public class FpShopUserRelProductDetailServiceImpl implements IFpShopUserRelProductDetailService{

	@Autowired
	private IFpShopUserRelProductDetailDao fpShopUserRelProductDetailDao;

	@Override
	public int insert(FpShopUserRelProductDetailDTO fpShopUserRelProductDetail) throws SQLException {
		return fpShopUserRelProductDetailDao.insert(fpShopUserRelProductDetail);
	}

	@Override
	public void update(FpShopUserRelProductDetailDTO fpShopUserRelProductDetail) throws SQLException {
		fpShopUserRelProductDetailDao.update(fpShopUserRelProductDetail);
	}

	@Override
	public void updateForce(FpShopUserRelProductDetailDTO fpShopUserRelProductDetail) throws SQLException {
		fpShopUserRelProductDetailDao.updateForce(fpShopUserRelProductDetail);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		fpShopUserRelProductDetailDao.delete(id);
	}
	
	@Override
	public List<FpShopUserRelProductDetailDTO> queryList(FpShopUserRelProductDetailDTO fpShopUserRelProductDetail) throws SQLException {
		return fpShopUserRelProductDetailDao.queryList(fpShopUserRelProductDetail);
	}

	@Override
	public int queryListCount(FpShopUserRelProductDetailDTO fpShopUserRelProductDetail) throws SQLException {
		return fpShopUserRelProductDetailDao.queryListCount(fpShopUserRelProductDetail);
	}

	@Override
	public FpShopUserRelProductDetailDTO loadById(Integer id) throws SQLException {
		return fpShopUserRelProductDetailDao.loadById(id);
	}
 	@Override
	public FpShopUserRelProductDetailDTO queryListGetFirst(FpShopUserRelProductDetailDTO fpShopUserRelProductDetail)
			throws SQLException {
		 List<FpShopUserRelProductDetailDTO> queryList = queryList(fpShopUserRelProductDetail);
		 if(queryList==null||queryList.size()==0){
			 return new FpShopUserRelProductDetailDTO();
		 }
		 return queryList.get(0);
	}
}
